#ifndef CAFFICHAGE_H
#define CAFFICHAGE_H

#include "myqglwidget.h"
#include "QtOpenGL"
#include "qdebug.h"
#include "cdrawable.h"
#include "ccamera.h"
#include "QVector"

class CAffichage : public myQGLWidget
{
	Q_OBJECT
public:
	explicit CAffichage(QWidget *parent = 0);
	void initializeGL();
	void resizeGL(int width, int height);
	void paintGL();

	void mousePressEvent(QMouseEvent *event);
	void mouseMoveEvent(QMouseEvent *event);
	void mouseDoubleClickEvent(QMouseEvent *event);
	void keyPressEvent(QKeyEvent * keyEvent);
	void enterEvent(QEvent * event);

	void set_mode_rendu(GLenum mode);
	void enable_lighting();
	void disable_lighting();

	void add_object(CDrawable* obj);

	GLfloat eloign;
        QVector<CDrawable*> objects;
	CCamera *camera;

private:
	GLfloat rotationX;
	GLfloat rotationY;
	GLfloat rotationZ;
	QPoint  lastPos;


	GLenum  mode_rendu;


};

#endif // CAFFICHAGE_H
